package com.hehe.boot.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hehe.boot.mapper.BookMapper;
import com.hehe.boot.pojo.Book;
import org.springframework.stereotype.Service;

@Service
public class BookService extends ServiceImpl<BookMapper, Book> {

    public Book findBookByName(String username) {
        QueryWrapper<Book> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username",username);

        return this.getOne(queryWrapper);
    }

    public boolean deleteById(Integer id) {
        return this.removeById(id);
    }

}
